package cp.remote.network;

import android.util.Log;

public abstract class Network implements Runnable {

    
    private boolean error = false;
    private String errormsg = "No Error";
    private String name = "NETWORK";
    
    Network(String name){this.name = name;}
    
    protected void error(String msg){
        error = true;
        errormsg = msg;
        Log.e(name, msg);     
    }
    
    protected void resetError(){
        error = false;
        errormsg = "";
        Log.w(name, "Error Reseted");        
    }

    public synchronized boolean isError() {
        return error;
    }

    public synchronized String getErrormsg() {
        return errormsg;
    }   
    
    public String getName(){return name;}

    abstract public boolean isRunning();
    abstract public boolean isConnected();

}
